﻿using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;

namespace RevitAddin
{
    /// <summary>
    /// 定义返回类型
    /// </summary>
    public class ResponseResult
    {
        /// <summary>
        /// 状态码
        /// </summary>
        [JsonProperty("code", Order = 1)]
        public HttpStatusCode Code { get; set; }
        /// <summary>
        /// 信息
        /// </summary>
        [JsonProperty("message", Order = 2)]
        public string Message { get; set; }
    }
    /// <summary>
    /// 定义泛型反回类型
    /// </summary>
    /// <typeparam name="T"></typeparam>
    public class ResponseResult<T> where T : class
    {
        /// <summary>
        /// Code
        /// </summary>
        [JsonProperty("code", Order = 1)]
        public HttpStatusCode Code { get; set; }
        /// <summary>
        /// 信息
        /// </summary>
        [JsonProperty("message", Order = 2)]
        public string Message { get; set; }
        /// <summary>
        /// 数据
        /// </summary>
        [JsonProperty("data", Order = 3)]
        public T Data { get; set; }
    }
}
